[API Compatibility] add torch.randint -part#801
Open
Manfredss wants to merge 3 commits into
Open
Conversation
|
Thanks for your contribution! |
b83db03 to
b956af6
Compare
Collaborator
|
这个需要修改torch.randint的Matcher为ChangePrefixMatcher |
618cf06 to
f8d96f4
Compare
f8d96f4 to
c349b32
Compare
…fixMatcher unsupported args - Change torch.randint matcher from RandintMatcher to ChangePrefixMatcher - Add requires_grad, pin_memory, device to ChangePrefixMatcher unsupported args list - Disable 2 incompatible test cases (2-arg form) - Add 15 new test cases covering keyword args, shuffled args, *args/**kwargs unpacking Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c349b32 to
04983c1
Compare
zhwesky2010
reviewed
Apr 24, 2026
|
|
||
| # temporary delete these unsupport args, which paddle does not support now | ||
| for k in ["layout", "generator", "memory_format", "sparse_grad", "foreach"]: | ||
| for k in ["layout", "generator", "memory_format", "sparse_grad", "requires_grad", "pin_memory", "device", "foreach"]: |
Collaborator
|
@Manfredss PR还需要改下 |
Contributor
Author
这样改了之后 test_case_12 会报错, 因为 |
Contributor
Author
@zhwesky2010 修改后的 randint api 在 paconvert 上测试通过 |
zhwesky2010
reviewed
Apr 30, 2026
|
|
||
|
|
||
| def test_case_2(): | ||
| def _test_case_2(): # 2-arg form: paddle.randint(low, high, shape) signature differs from torch.randint(high, size) |
|
|
||
|
|
||
| def test_case_10(): | ||
| def _test_case_10(): # 2-arg form: paddle.randint(low, high, shape) signature differs from torch.randint(high, size) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PR Docs
add torch.randint
PR APIs
related paddle pr: 77194